1. Field of the Invention
The invention relates generally to computer systems and more particularly to systems and methods for performing multiplication of fixed-point fractional values with the same throughput as addition and subtraction operations, and without loss of accuracy in the result.
2. Related Art
Modern computer systems provide ever-increasing capacity to process data. This capacity is expanded by making processors faster, smaller and more efficient. Often, computer systems will implement several processor cores to process data in parallel. Even the processors themselves may be designed to process instructions that have a single command and multiple data items. The systems must be designed, however, to process instructions as quickly as possible in order to take advantage of their speed and size.
For example, many modern processors are intended to be used for multimedia applications in which a large number of relatively complex instructions must be executed. One of the common functions performed by these processors is color conversion. A typical multimedia processor continuously performs color conversion on the image data that is displayed to the user, so inefficiency in this process can drastically reduce the performance of the processor.
An example of a color conversion computation is illustrated below. In this example, a color data consisting of RGB component values is converted into YUV component values. The conversion is performed using a matrix of conversion coefficients Cij. The conversion function is defined by the equations:Y=C11*R+C12*G+C13*B U=C21*R+C22*G+C23*B V=C31*R+C32*G+C33*B where each of the RGB component values is between 0 and 2, each of the conversion coefficients is between −2 and 2, each of the Y component values is between 0 and 1, and each of the UV component values is between −1 and 1. Both the color component values and the conversion coefficients are 8-bit values.
Thus, color conversion comprises a series of fixed point multiplication instructions. Multiplication instructions typically take longer to execute than addition or subtraction instructions. One of the reasons for this difference is that multiplication of two values of a first width yields a result of twice that width. For instance, multiplication of two 8-bit values yields a 16-bit result. It is typically necessary to store this twice-width result in a special register (or in two single-width registers), then shorten the result value so that it can be stored in one single-width register. This adds to the time required to execute the instruction.
It would therefore be desirable to provide systems and methods for performing fixed-point fractional multiplication of the type used in color conversion without requiring more time than an addition or subtraction operation, and without loss of accuracy in the result.